﻿@using EcBlog.Properties
@using Recaptcha;
@model EcBlog.Models.NewCommentViewModel
@using (Html.BeginForm())
{
    @Html.ValidationSummary(true)
    @Html.HiddenFor(model => model.PageId)
   
    <div class="leastImportantContainer">
        <table cellpadding="0" cellspacing="0" border="0">
            <tr>
                <td style="width: 10%;">
                    <div class="editor-label" style="text-align: right;">@Html.LabelFor(model => model.Comment.UserName)</div>
                </td>
                <td>
                    <div class="editor-field">@Html.EditorFor(model => model.Comment.UserName)@Html.ValidationMessageFor(model => model.Comment.UserName)</div>
                </td>
            </tr>
            <tr>
                <td>
                    <div class="editor-label" style="text-align: right;">@Html.LabelFor(model => model.Comment.Email)</div>
                </td>
                <td>
                    <div class="editor-field">@Html.EditorFor(model => model.Comment.Email)@Html.ValidationMessageFor(model => model.Comment.Email)</div>
                </td>
            </tr>
            <tr>
                <td>
                    <div class="editor-label" style="text-align: right;">@Html.LabelFor(model => model.Comment.CommentHtml)</div>
                </td>
                <td>
                    @Html.EditorFor(model => model.Comment.CommentHtml)
                    @Html.ValidationMessageFor(model => model.Comment.CommentHtml)
                </td>
            </tr>
            <tr>
                <td>
                    
                </td>
                <td>
                    @Html.Raw(Html.GenerateCaptcha("captcha", "clean"))
                    @Html.ValidationMessage("captcha")
                </td>
            </tr>
            <tr>
                <td>
                    <div class="editor-field" style="float: right;">@(Html.CheckBoxFor(model => model.Comment.SendResponseMail, new { @class = "Checkbox" }))</div>
                </td>
                <td>
                    <div class="editor-label" style="text-align: left;">@Html.LabelFor(model => model.Comment.SendResponseMail)</div>
                </td>
            </tr>
        </table>
        <p style="margin: 10px; padding: 10px;">
            @Html.AntiForgeryToken()
            <input type="submit" value="@ModelLocalization.SendComment" />
            @if (!string.IsNullOrEmpty(Model.Message))
            {
                @Model.Message
            }
        </p>
    </div>
}